<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="d1">
        <p>段落1</p>
        <p>段落2</p>
        <p>段落3</p>
        <p>段落4</p>
        <p>段落5</p>
    </div>
    <script>
        let nodes = document.getElementsByTagName("p");
        let nodes1 = document.querySelectorAll("p");
        console.log(nodes);
        console.log(nodes1);

        let d1 = document.getElementById("d1");
        let p = document.createElement("p");
        let text = document.createTextNode("段落6");
        p.appendChild(text);
        d1.appendChild(p);

       
        console.log(nodes);
        console.log(nodes1);
    </script>
</body>
</html>